document.addEventListener('DOMContentLoaded', () => {
    var number = document.getElementById('likes-number')
    var likesbtn = document.getElementById('likes-btn')
    likesbtn.addEventListener('click', () => {
        fetch('/images/likes/' + likesbtn.dataset.imageid, {method: 'POST'}) 
            .then(response => response.json())
            .then(data => {
                number.textContent = data.likes
            })
    })
})